import request from "../utils/request";

export function login(params) {
    return request({
        url: "/user/login",
        method: "post",
        params,
    });
}

/**
 *
 * @param {根据用户标识查询所属模块} params
 * @returns
 */
export function listUserMenu(params) {
    return request({
        url: "/userMenu/listUserMenu",
        method: "post",
        params,
    });
}

/**
 *
 * @param {添加用户权限} params
 * @returns
 */
export function addUserMenu(params) {
    return request({
        url: "/userMenu/addUserMenu",
        method: "post",
        params,
    });
}

/**
 *
 * @param {修改密码} params
 * @returns
 */
export function updatePassword(params) {
    return request({
        url: "/user/updatePassword",
        method: "post",
        params,
    });
}

/**
 * 添加用户
 */
export function addUser(params) {
    return request({
        url: "/user/addUser",
        method: "post",
        params,
    });
}

/**
 * 编辑用户
 */
export function editUser(params) {
    return request({
        url: "/user/updateUser",
        method: "post",
        params,
    });
}

/**
 * 删除用户
 */
export function delUser(params) {
    return request({
        url: "/user/delUser",
        method: "post",
        params,
    });
}

/**
 * 查询用户
 */
export function getUserList(params) {
    return request({
        url: "/user/listUser",
        method: "post",
        params,
        headers: { showLoading: true },
    });
}

/**
 * 不带权限查询热源换热站系统
 */

export function getHourseTree(params) {
    return request({
        url: "/heatSource/listTreeFullDetail",
        method: "post",
        params,
    });
}

/**
 * 添加权限查询
 */
export function addHourseTree(params) {
    return request({
        url: "/userHeatStation/addUserHeatStation",
        method: "post",
        params,
    });
}

/**
 * 根据用户权限查询热源树结构
 */
export function getHourseTreePermiss(params) {
    return request({
        url: "/userHeatStation/listUserHeatS",
        method: "post",
        params,
    });
}